// PlaneButton.h: interface for the CPlaneButton class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PLANEBUTTON_H__F560D682_2133_11D4_97A5_0050BF0FBE67__INCLUDED_)
#define AFX_PLANEBUTTON_H__F560D682_2133_11D4_97A5_0050BF0FBE67__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "D3DPlane.h"

class CPlaneButton  
{
public:
	CWnd *pParent;
	CD3DPlane *pPlane;
	int CmndID;
	int BtnKind;
	
	BOOL bShow;
	BOOL bEnable;
	BOOL bClick;
	BOOL bOver;
	BOOL bSelected;
	BOOL bHighlighted;
	int Xp, Yp;
	int Width, Height;
	int HighlightCnt;
	int m_iHighlightEndCount;

	int m_iBakcRenderPosX;
	int m_iBakcRenderPosY;


	int SprBack;
	int SprNormal;
	int SprOver;
	int SprClick;
	int SprDisable;
	int SprHighlight;

	POINT BackOffset;

	CPlaneButton();
	virtual ~CPlaneButton();
	void Init(CWnd *pWnd, int x, int y, CD3DPlane *pplane, int cmndid);
	void InitBackBtn(CWnd *pWnd, int x, int y, CD3DPlane *pplane, int cmndid,int iBackPosX = 0, int iBackPosY = 0);
	void InitLightBtn(CWnd *pWnd, int x, int y, CD3DPlane *pplane, int cmndid);
	void InitTabBtn(CWnd *pWnd, int x, int y, CD3DPlane *pplane, int cmndid);
	void InitItemBtn(CWnd *pWnd, int x, int y, CD3DPlane *pplane, int cmndid);

	void SetButtonSpr(int sprnormal);
	void SetButtonBack(int sprback, int ox, int oy);
	void SetPlane(CD3DPlane *pplane);
	
	void Enable(BOOL bVal);
	void Show(BOOL bVal);
	void SetHighlight();
	void SetHighlight(BOOL bHighlightedFlag, int iHighlightEndCount);
	
	int ProcessButton(POINT mp, BOOL bPress, BOOL bFirstPress);
	void Draw();
};


#endif // !defined(AFX_PLANEBUTTON_H__F560D682_2133_11D4_97A5_0050BF0FBE67__INCLUDED_)
